package com.handpay.zztong.hp.login.bill;

import android.text.TextUtils;

import com.handpay.framework.ClientEngine;
import com.handpay.framework.SecureManager;
import com.handpay.zztong.hp.base.activity.ZZTongActivity;
import com.handpay.zztong.hp.bean.ResponseBean;
import com.handpay.zztong.hp.protocol.BaseProtocolKey;
import com.handpay.zztong.hp.utils.AccountUtils;

import java.util.Hashtable;



/**
 * @author sxshi on 2017/2/21.
 *         处理发送验证码相关的业务类
 */

public class AuthCodeBill {
    private ZZTongActivity mContext;

    public AuthCodeBill(ZZTongActivity mContext) {
        this.mContext = mContext;
    }

    /**
     * 发送验证码
     *
     * @param action      请求的Action
     * @param phoneNumber 手机号码
     */
    public void sendAuthCode(String action, String phoneNumber) {
        Hashtable<String, String> paramers = new Hashtable<String, String>();
        String account;
        if (TextUtils.isEmpty(phoneNumber)) {
            account = AccountUtils.getAccountPhone(mContext);
        } else {
            account = phoneNumber;
        }
        if (!TextUtils.isEmpty(account)) {
            paramers.put(BaseProtocolKey.ACCOUNT, SecureManager.getInstance().des(account, 1, null));
            paramers.put("action", action);
            paramers.put(BaseProtocolKey.CHANNEL, ClientEngine.CHANNEL);
//            mContext.doJsonPost(true, mContext, Do_SendPhoneCode, ResponseBean.class, paramers, false);
        }
    }
}
